1、解压ST的源码
	tar -xvf en.SOURCES-stm32mp1-openstlinux-5-4-dunfell-mp1-20-06-24.tar.xz
2、进入stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-2.2.r1-r0/目录
	cd stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-2.2.r1-r0/
3、解压TFA源码
	tar -vxf tf-a-stm32mp-2.2.r1-r0.tar.gz
4、进入TFA源码目录
	cd tf-a-stm32mp-2.2.r1/
5、为FTA打上ST的补丁
	for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
6、修改Makefile.sdk的编译器前缀
	将14行中的arm-ostl-linux-gnueabi-替换为arm-none-linux-gnueabihf-
7、进行编译测试
	make -f ../Makefile.sdk all
8、添加设备树文件
	开发板参考STM32MP157D EVK设计，其设备树是stm32mp157d-ev1，又因stm32mp157d-ev1引用 stm32mp157d-ed1，所以这里以stm32mp157d-ed1为蓝本
	stm32mp157d-ed1.dts描述ed1开发板的特有属性
	cp fdts/stm32mp157d-ed1.dts fdts/stm32mp157d-atk.dts
	stm32mp15xx-edx.dtsi描述ed系列开发板公共属性
	cp fdts/stm32mp15xx-edx.dtsi fdts/stm32mp157d-atk.dtsi
9、修改设备树stm32mp157d-atk.dts
	gedit fdts/stm32mp157d-atk.dts
	将12行的stm32mp15xx-edx.dtsi修改为stm32mp157d-atk.dtsi
	将16行的STMicroelectronics STM32MP157D eval daughter修改为Alientek STM32MP157DAA development board
	将17行stm32mp157d-ed1修改为stm32mp157d-atk
10、修改Makefile.sdk增加stm32mp157d-atk的编译选项
	gedit ../Makefile.sdk
	在第24行后面增加stm32mp157d-atk编译选项
11、进行编译测试
	make -f ../Makefile.sdk all
12、修改设备树stm32mp157d-atk.dtsi
	gedit fdts/stm32mp157d-atk.dtsi
	删除&i2c4节点，它描述的是连接在i2c4总线上的电源管理芯片STPMIC1A，开发板中未使用此芯片
	删除跟节点中的vin节点
	在跟节点中增加描述电源的节点：
		vddcore: regulator-vddcore {
			compatible = "regulator-fixed";
			regulator-name = "vddcore";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1350000>;
			regulator-off-in-suspend;
			regulator-always-on;
		};
		
		v3v3: regulator-3p3v {
			compatible = "regulator-fixed";
			regulator-name = "v3v3";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-off-in-suspend;
			regulator-always-on;
		};
		
		vdd: regulator-vdd {
			compatible = "regulator-fixed";
			regulator-name = "vdd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-off-in-suspend;
			regulator-always-on;
		};
		
		vdd_usb: regulator-vdd_usb {
			compatible = "regulator-fixed";
			regulator-name = "vdd_usb";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-off-in-suspend;
			regulator-always-on;
		};
	修改&sdmmc1节点：
		&sdmmc1 {
			pinctrl-names = "default";
			pinctrl-0 = <&sdmmc1_b4_pins_a>;
			st,neg-edge;
			broken-cd;
			bus-width = <4>;
			vmmc-supply = <&v3v3>;
			status = "okay";
		};
	修改&sdmmc2节点：
		&sdmmc2 {
			pinctrl-names = "default";
			pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
			non-removable;
			st,neg-edge;
			bus-width = <8>;
			vmmc-supply = <&v3v3>;
			vqmmc-supply = <&v3v3>;
			status = "okay";
		};
	修改&usbotg_hs节点
		&usbotg_hs {
			phys = <&usbphyc_port1 0>;
			phy-names = "usb2-phy";
			usb-role-switch;
			status = "okay";
		};
	增加&usbphyc节点
		&usbphyc {
			status = "okay";
		};
11、进行编译测试
	make -f ../Makefile.sdk all
	编译后在../build/trusted/目录下生成可烧写到flash中的固件tf-a-stm32mp157d-atk-trusted.stm32
12、修改Makefile.sdk编译目标
	gedit ../Makefile.sdk
	将第15行的EXTRA_OEMAKE_SERIAL= STM32MP_UART_PROGRAMMER=1 STM32MP_USB_PROGRAMMER=1修改为EXTRA_OEMAKE_SERIAL=$(filter-out STM32MP_SDMMC=1 STM32MP_EMMC=1 STM32MP_SPI_NOR=1 STM32MP_RAW_NAND=1 STM32MP_SPI_NAND=1,$(EXTRA_OEMAKE)) STM32MP_UART_PROGRAMMER=1 STM32MP_USB_PROGRAMMER=1
13、编译烧写过程中所需要使用的固件
	make -f ../Makefile.sdk TFA_DEVICETREE=stm32mp157d-atk TF_A_CONFIG=serialboot ELF_DEBUG_ENABLE='1' all
	编译完成后在../build/serialboot/目录下生成烧写过程需要使用的固件tf-a-stm32mp157d-atk-serialboot.stm32
	在此编译步骤中不会生成../build/trusted/目录
